<template>
	<view class="real">
		<uv-navbar placeholder autoBack bgColor="#CA1C1D">
			<template v-slot:left>
				<view class="left_slot">
					<image src="@/static/images/back.png"></image>
				</view>
			</template>
			<template v-slot:center>
				<view class="nav_title">实名认证</view>
			</template>
		</uv-navbar>
		<view class="content">
			<view class="item">
				<view class="key">姓名</view>
				<view class="item_view">
					<input type="text" disabled v-model="data_info.name">
				</view>
			</view>
			<view class="item">
				<view class="key">证件类型</view>
				<view class="item_view">
					<input type="text" disabled v-model="data_info.idtype">
				</view>
			</view>
			<view class="item">
				<view class="key">证件号</view>
				<view class="item_view">
					<input type="text" disabled v-model="data_info.identity">
				</view>
			</view>
			<view class="item">
				<view class="key">证件有效期类型</view>
				<view class="item_view">
					<input type="text" disabled v-model="data_info.idvalidity_type">
				</view>
			</view>
			<view class="item">
				<view class="key">证件有效期开始时间</view>
				<view class="item_view">
					<input type="text" disabled v-model="data_info.idvalidity_begin">
				</view>
			</view>
			<view class="item">
				<view class="key">证件有效期结束时间</view>
				<view class="item_view">
					<input type="text" disabled v-model="data_info.idvalidity_end">
				</view>
			</view>
			<view class="item">
				<view class="key">开户银行</view>
				<view class="item_view">
					<input type="text" disabled v-model="data_info.card_bank">
				</view>
			</view>
			<view class="item">
				<view class="key">银行所在地区</view>
				<view class="item_view">
					<input type="text" disabled v-model="data_info.card_locales">
				</view>
			</view>
			<view class="item">
				<view class="key">开户账号</view>
				<view class="item_view">
					<input type="text" disabled v-model="data_info.card_account">
				</view>
			</view>
			<view class="item">
				<view class="key">银行卡开户名</view>
				<view class="item_view">
					<input type="text" disabled v-model="data_info.card_name">
				</view>
			</view>
			<view class="item">
				<view class="key">预留手机号</view>
				<view class="item_view">
					<input type="text" disabled v-model="data_info.mobile">
				</view>
			</view>
		</view>
	</view>
</template>

<script setup>
	import {
		realname
	} from "@/request/api";
	import {
		ref
	} from "vue";
	const data_info = ref({});
	const getDeta = async () => {
		let {
			idtype,
			hbsk_bank,
			realname: realname_value
		} = await realname();
		realname_value.idtype = idtype[realname_value.idtype];
		let dataItem = hbsk_bank.find(item => item.code == realname_value.card_bank);
		realname_value.card_bank = dataItem.name;
		realname_value.idvalidity_type = realname_value.idvalidity_type ? "长期有效" : "非长期有效";
		data_info.value = realname_value;
	};
	getDeta();
</script>

<style scoped lang="scss">
	.real {
		min-height: calc(100vh - var(--window-top) - var(--window-bottom));

		.left_slot {
			image {
				width: 43rpx;
				height: 36rpx;
			}
		}

		.nav_title {
			color: #F5F5F5;
			font-size: 36rpx;
		}

		.content {
			padding: 40rpx 20rpx;
			box-sizing: border-box;

			.item {
				.key {
					color: #333333;
					font-size: 28rpx;
					padding-left: 10rpx;
					padding-top: 30rpx;
					padding-bottom: 20rpx;
					box-sizing: border-box;
				}

				.item_view {
					width: 100%;
					border-radius: 20rpx;
					border: 1px solid #CCCCCC;
					padding: 0 30rpx 0 42rpx;
					box-sizing: border-box;
					background: #EEEEEE;
					display: flex;
					align-items: center;

					.key {
						width: 100%;
						height: 110rpx;
						line-height: 110rpx;
					}

					input {
						width: 100%;
						height: 110rpx;
					}
				}
			}
		}
	}
</style>